package com.base.cn.platform.os.common.mybatis.sharding;

import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr;

import java.util.Map;
import java.util.Set;

/**
 * join条件处理
 *
 * @author s.li
 * @create 2019-05-23 12:20
 */
public class JoinOnCondition {

    public static void joinOn(SQLExpr joinOnCondition, Set<String> columnSet, Map<String,Object> shardingValues){
        if(joinOnCondition !=null ){
            if(joinOnCondition instanceof SQLBinaryOpExpr){
                SQLBinaryOpExpr binaryOpExpr = (SQLBinaryOpExpr) joinOnCondition;
                ShardingValueUtil.addShardingValue(columnSet,shardingValues,binaryOpExpr);
            }
        }
    }
}
